package com.kelaite.procurement.config;

import org.springframework.boot.context.embedded.FilterRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.orm.jpa.support.OpenEntityManagerInViewFilter;


@Configuration
public class MyOpenSessionInViewFilter extends OpenEntityManagerInViewFilter{

	@Bean  
    public FilterRegistrationBean filterRegistrationBean(OpenEntityManagerInViewFilter filter){  
        FilterRegistrationBean filterRegistrationBean = new FilterRegistrationBean();  
        filterRegistrationBean.setFilter(filter);  
        filterRegistrationBean.setEnabled(true);  
        filterRegistrationBean.addUrlPatterns("/*");  
        return filterRegistrationBean;  
    }   
	
}
